package com.gzsxy.esjy.service.core.sign.service.doc;



import com.gzsxy.esjy.service.core.sign.dto.DocumentSignDto;
import com.gzsxy.esjy.service.core.sign.entity.ArraignSign;
import com.gzsxy.esjy.service.core.util.PdfUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangxiaolong
 * @date 2022/7/13 11:36
 * @Desc 默认文书处理实现类
 */
@ConditionalOnProperty(name = "document.diy.area", havingValue = "default")
@Slf4j
@Component
public class DefaultImpl extends  DocBaseService implements DocHandleService {


    /**
     *  默认叠加日期
     * @param arraignSign 需要叠加日期的文书信息
     * @param startTime 指定开始时间
     * @param endTime 指定结束时间
     * @param content 当前时间字符串
     * @param sealFileType 签名pdf文件路径
     */
    @Override
    public void doSign(ArraignSign arraignSign, String startTime, String endTime, String content, File pdfFile,String sealFileType) {
        List<PdfUtils.PdfMark> markList = new ArrayList<>();
        defaultDoSign(markList, arraignSign, startTime, endTime, content);
        defaultPdfOverlayDate(arraignSign, pdfFile,sealFileType, markList);
    }

    /**
     * 默认文书盖章
     *  @param arraignSign
     * @param documentSignDto
     * @param sealFilePath 盖章文件路径
     * @param pdfFile PDF文件
     * @param pdfFileType pdf文件类型
     */
    @Override
    public void doSeal(ArraignSign arraignSign, DocumentSignDto documentSignDto, String sealFilePath, File pdfFile, String pdfFileType) {
        defaultDoSeal(arraignSign, sealFilePath, pdfFile, pdfFileType);
    }


}
